Optimal sizing and operation of a hybrid energy systems via response surface methodology (RSM)

Hybrid energy systems (HESs) are the most important sources of energy demand-supply, have developed significantly around the world. Microgrids, renewable energy sources, remote telecommunications stations, greenhouses, etc., are being considered as HESs applications. Optimal sizing of these systems is considered as one of the important issues related to energy management. In this paper, the Response Surface Methodology (RSM) is proposed for the optimal sizing of a Photovoltaic (PV) system in a HESs. The suggested procedure solves the optimization problem by considering the factors affecting PV output power about the environmental conditions of the HESs. Providing a mathematical model for each of the input parameters and the ability to assessment the sensitivity of each of the input variables are the most important advantages of the proposed technique. In this paper, the RSM provides the most optimal sizing related to the PV system by considering climatic and geographical factors in the study site, and technical and economic issues related to the HESs. The optimal model obtained is evaluated by the Analysis of Variance (ANOVA) evaluation method, which is one of the important techniques of statistical evaluation. It should be noted that the RSM technique can be utilized to optimize all components of any HES.

Table 1.Different types of sizing methods.

Graphic construction methods
Average wind speed and solar radiation are selected in this method Some systems such as PV-battery and PV-wind turbines are considered as energy sources The slope angle of the PV system and the installation height of the wind turbine are considered as the limitation of this method Probabilistic method Sizing of the PV panels and wind turbines are considered as input while solar, wind, and batteries storage systems are considered as energy sources The dynamic performance related to the hybrid system is not illustrated in this technique 15,16   Analytical methods Average wind speed and solar radiation are selected in this method Considered solar irradiation, wind speed, battery storage systems, biomass systems are depending on the type of software Low flexibility in the designing process can be considered a limitation 8,9,26   Iterative methods Average of the wind speed and the solar radiation is considered in this method or sizing of the PV panels and, wind turbines are considered as input in this procedure The slope angle of the PV system and the installation height of the wind turbine are considered as the limitation of this method power, heat, and water demand by an area.The studied system comprises the PV, battery storage internal combustion engine, boiler, fuel tank, and water storage.The PV and internal combustion engines are utilized to generate heat and electricity.Also, fuel is utilized in the boiler and internal combustion engine to generate heat.Then, a pump is used to produce hot and cold airflow and storage sources for hot and cold air and water are considered.In this method, simultaneous size and performance optimization is performed, so that the amount of consumption and conditions of the area during 24 h are considered.In the proposed system, electricity, heat, hot and cold air, and water are provided and various parts of the system are optimized.In this study, for different parts of the system, an equation appropriate to the conditions of the region is presented.Then, the RSM technique is selected to determine the optimal size of components such as PV panels, inverter, etc., and reduce the computational burden.Selecting the value of variables with a minor amount of error is one of the most important advantages of the proposed procedure.In addition, the RSM can model the performance of all system components individually in mathematical formula mode.Thus, the performance of each component in the whole system can be easily analyzed.To express the effectiveness of the proposed model of this study, a comparative analysis between proposed RSM-based approach and several well-known optimization techniques, including GA, PSO, and BBO is performed.This comparison highlights: -Computational Efficiency: The RSM demonstrated superior computational efficiency, particularly in scenarios with complex, multi-modal landscapes, due to its capability to reduce the number of simulations required.-Solution Quality: Suggested RSM method produced competitive or superior solutions in terms of the objective functions, especially in balancing multiple criteria such as cost and energy efficiency.-Flexibility and Scalability: The RSM-based approach provided flexibility in handling various system constraints and scales, outperforming traditional methods in adaptability.
To clarify, the novelty of this research lies in the following aspects: Integration of RSM in HES optimization: While Response Surface Methodology (RSM) has been widely used in various fields, its application in optimizing HES, particularly for the simultaneous sizing and operation strategy, remains limited.This study pioneers this integration, offering a systematic and computationally efficient approach to address the complexity of such systems.The searching speed is so high Also, the instructor of this approach is so simple in comparison to other plans Optimizing the non-coordinated system is so hard with the use of this approach The premature convergence process is so complicated in this approach 37

Imperialist competition algorithm It is based on social and political movements
The convergence accuracy is so high in this approach.This approach can easily handle the high dimension of nonlinear hybrid systems The process of computation is so complicated 38,39   Hybrid optimization techniques It is operated based on the integration of several algorithms The accuracy of the obtained results is high.Also, the computational time is low in the mentioned approach The process of writing the code is so complicated 40-42

Case study
The studied test system is a PV-based combined cooling, heat and power (CCHP) system 43 that is located in North West of Iran.The solar irradiation of the region is between 1700 and 1800 kWh/m 2 .The studied system is comprised of a PV panel, internal combustion engine, boiler, reversible heat pump, pump as turbine, electrical energy storage (battery), inverter as power transformation which converts the DC output of the battery to the AC and thermal and cooling energy storage.Thermal energy can be produced by the combustion engine, boiler heat losses, and by the heat pump.Also, the heat pump can produce cooling energy by working in reverse mode.
The fuel tank is used as a fuel of the system and, upper and lower reservoirs are utilized to store the water.Table 3 shows the required amount of water, electricity, and cooling and heating energy for a day.During the winter days, the required amount related to heating energy and electricity increases, and the amount of cooling energy has reached 0 kWh.The plant schematic is shown in Fig. 1.According to this figure, the proposed system is a hybrid system that can supply electricity and cooling, and heating, which are called trigeneration systems.Trigeneration systems are up to 50% more efficient annually than power plants of the same size.This plant is consists of a PV system, an internal combustion engine (ICE), a boiler (BL), and two pumps, one as a reversible heat pump (RHP) and one as a pump as a turbine (PAT).The PV and ICE systems are used to generate electricity.The fuel Tank plays the role of fueling the BL and ICE.BL and ICE are used to generate heating and cooling energy.By using the RHP, the cooling energy requirement can be met in reverse mode.In the introduced system, battery (BAT), cold thermal storage (CS), hold thermal storage (HS), upper reservoir (UR), and a lower reservoir (LR) are storage systems.The amount of radiation (G), temperature (T), cost (C) and longitude (E), and height of upper reservoir (H) are considered as effective parameters on this system.These data are considered appropriate to the study area.Water is moved between two sources by the PAT.The height difference between the two reservoirs is considered to be 50 m.

Problem formulation
The electrical and thermal balance is provided in Eqs.
where P PV is the generated electric power by PV and P BAT is the storage power in BAT.P us is electricity demand.P ICE shows the power produced by ICE, P PAT is the power of PAT, and η INV represent the inverter coefficient.If the sum of P PV and P BAT is greater than 0, the amount of user power can be calculated by Eq. (1) otherwise, it can be calculated from Eq. ( 2).Q ICE demonstrate the heat generated by ICE and Q Bl illustrate the heat generated by BL.Q h,RHP and Q c,RHP are the heat and cooling generated by the reversible heat pump, respectively.Q HS and Q CS are the heat and cool that stored in HS and CS.Q h,us and Q c,us depicts the heat and cool demand, respectively.
(1) If (P PV + P BAT ) > 0 then P us = (P PV + P BAT ) * η INV + (P ICE + P PAT ) (2) where m UR represents the flow rate of the tank.The variable m us denotes the water demand of the resort, and m PAT corresponds to the flow rate of the pump.The maximum and minimum flow rates of the PAT , as well as the maximum and minimum State of Charge (SOC) of the batteries, along with the maximum charging/discharging rates, and the maximum and minimum loads for the ICE, RHP, and BL , are established based on the devices' specifications.To prevent disruptions in system management for the subsequent days, it is required that, by the end of each day, the water level in the tank, the SOC of the batteries, and the state of the thermal storage systems be restored to their initial conditions as observed at the beginning of the day 44 : The optimization problem is formulated as a single objective function that incorporates the costs associated with the devices, fuel consumption, and penalties for any constraint violations.The final equation is: where F X j represents the cost function, z is the penalty multiplier, and VIOL z denotes the magnitude of the violation for constraint z.
Finally, the objective function of the studied system is provided as follows 44 : (5) where C shows the cost of each component, S represents the size of each component, C f is the fossil fuel cost, and m f .hdemonstrate the total amount of fuel consumed by the BL and the ICE.Table 4 shows the estimated costs for each system component and fuel.
The Design of Experiments (DOE), which is a quality improvement method allows to users for determining the sensitivity of each component to the various variables in the studied test system.The output of this method is a mathematical formulation that is determined based on the nature of the operation.It is noteworthy that the mentioned formulation is so exact and stable.Also, this constructed formulation can help us to determine the size of the components without any difficulties.Finally, the environmental and climate conditions, which are essential factors in sensitivity calculation are considered in the mentioned approach while it is not found in the PSO approach 44 .Fill factorial, RSM, mixture, and Taguchi are various types of DOE applications which the RSM method is selected to use in this paper.The low computation burden of the RSM is the significant merit of this approach to the PSO.In other words, this method is provided a new formulation for each component of the studied system instead of giving a final strategy that is calculated based on the reputation concept 45 .As shown in Fig. 2 which is the RSM flowchart, the input data of the RSM are the meteorological parameters and the cost of system components.In this study, G, T, C, E, H are the meteorological parameters and design variables.In this state, should define the minimum and maximum values of inputs.Then, the full factorial design is selected to calculate the model and the evaluating the impact of parameters (sensitivity analysis).In the following the size of each component is defined as new parameters.The parameters range was defined by minimum and maximum levels as shown in Table 5.In the next step, the RSM evaluates samples and makes a global model.

Design variables
The Central composite design toolbox in the MINITAB software has been employed to solve the aforementioned problem.In this regard, the minimum and maximum values related to the variables are entered as input data in a simulation.The obtained results for different components are reported in Tables 6.Also, Table 7 is the other outputs of the simulation that are calculated based on the various environmental conditions.Table 6 shows, the series of the RSM for each component, 31 experiments in the optimization procedure.Table 7 shows, the series of the Response Surface Methodology for environmental conditions, it includes 30 experiments for different combinations of the input variables.Standard order (StdOrder) is the non-randomized order of the runs while run order (RunOrder) is a randomized order of the terms.Point type (PtTyoe) contains 3 levels that are 0, -1 and 1. 0 indicates the center point, 1 is a corner point, and -1 is an axial point.
Variance Inflation Factor (VIF) indicated the correlated status of the parameter.In other words, VIF = 1 indicted that the data do not have any correlation with one another, and 1 < VIF < 5 indicates the moderate relationship between the parameters and finally 5 < VIF < 10 suggests that the settings have a high association with each other.
The Standard Error (SE) coefficient is used to avoid the repeated results in the selection process.The T-Value is responsible for calculating the ratio between the factor and the standard error of each parameter.www.nature.com/scientificreports/P-Value is considered as a probability that is used to measure the evidence against the null hypothesis.By reducing the amount of expectations, stronger evidence is obtained against the null hypothesis.
In the second step, to determine the final problem formulations, the obtained results of Tables 6 and 7 are mixed with each other.For instance, Table 8 indicates the mixture of the S PV that is reported in Tables 6 and 7. Also, the series of the Response Surface Methodology for S PV , it includes 31 experiments for different combina- tions of the environmental variables which has affected the size are shows in Table 8.The ANOVA table for the coded coefficients in the studied system model is presented in Table 9.

Results
In this paper, Eq. ( 11) is used to determine the optimal problem formulation of each component that is in Full Quadratic mode, and the obtained formulations are reported as follows: www.nature.com/scientificreports/The equations presented detail the relationship between various factors (G, T, C, E, F, and H) and the sizing of components (S pv , S bat , S inv , etc.) .The quadratic nature of these equations highlights both linear and nonlinear interactions.This indicates that the system's performance and component sizing are influenced by both direct and interactive effects of these variables.After evaluating the model and obtaining a mathematical model for each of the problem variables, they can be sensitively analyzed via various plot models.Figures 3 and 4 illustrate the Contour plots and surface plots of S PV in interaction with various model parameters, respectively.
Contour Plot is utilized to plot the correlation between the variables of fitted response and two continuous.A contour plot shows 2-dimensional views in which points with the same response values are connected to generate contour lines.Contours can be illustrated by shaded areas, contour lines, or both of them.These graphs help us to show the process of the simulation.Changes from blue to green indicate the improvement in the level of the obtained results.Finally, the higher accuracy in the results is illustrated by darker colors.
Surface plots extract the relationship and correlation between three variables.The variables of predictor are illustrated on two scales of the figure, and the response variable is illustrated on the chart.A contour plot prepares a 2-dimensional view of the surface in which the points with the same response are connected to plot the contour lines that illustrate the constant reactions.Contour plots are advantageous and useful to establish the response values and operating conditions that are desirable.These plots show the order of variables in terms of their effect on S PV .Figure 5 shows the responses obtained for evaluating each of the variables affecting on the S PV in the forms of Residual plot.
The contour and surface plots (Figs. 3 and 4) visually represent the interactions between pairs of variables and their impact on a particular component (e.g., Spv).These plots are crucial for understanding the sensitivity of the component's performance to changes in the variables.For instance, the contour plots show how combinations of temperature and solar irradiance affect the photovoltaic system's size (Spv).The gradients and shapes of these plots help identify regions of optimal operation, where the system's performance is maximized or costs are minimized.This visual analysis supports decision-making by highlighting critical areas where adjustments can lead to significant improvements.
Residual plots are graphs that are tested in the ANOVA environment to check the accuracy of the results.These plots show that the model fits well to optimize all of the independent variables.It is observed that the scatter of data points and standard curves have a high regression coefficient and correlation.Also, the above figures confirm the typical distribution of residuals and the high performance of the models extracted from the studied system.
The residual plots (Fig. 5) validate the model's accuracy in predicting system behavior.The distribution of residuals, which should ideally be random and show no discernible pattern, indicates the goodness of fit of the model.In our study, the residual plots demonstrate a high correlation coefficient, suggesting that the model accurately captures the relationship between the inputs and outputs.This accuracy is crucial for ensuring that the optimization model is reliable and can be used confidently to make decisions about system design and operation.The implications of our findings are multifaceted.Firstly, the detailed equations provide a framework for accurately sizing each component of the hybrid energy system, ensuring that they operate within optimal parameters.This contributes to the system's overall efficiency and cost-effectiveness.Additionally, the sensitivity analysis via contour and surface plots guides system designers in understanding the impact of environmental and economic variables, thus aiding in robust decision-making under varying conditions.
This study relies on data specific to the region of Iran, including climate data, energy consumption patterns, and economic factors.While this data is sufficient for our analysis, we acknowledge that variations in data quality and availability in other regions could impact the applicability and precision of our findings.Future studies should consider the variability and quality of local data to enhance the accuracy and relevance of the model.
The validity of the RSM-based optimization model is contingent upon the assumptions made during the modeling process, such as linearity and the smoothness of the response surface.These assumptions might not hold in all scenarios, particularly in cases involving non-linear interactions or discontinuities in the system behavior.Additional validation with diverse datasets and scenarios would help to verify and refine the model's accuracy and robustness.
Future research could focus on applying the RSM-based optimization framework to different climates and geographic regions.This would involve collecting and integrating local data, which could provide insights into the model's adaptability and the scalability of the proposed solutions.
Integrating more advanced data analytics techniques, such as machine learning, could improve the accuracy of the response surfaces, particularly in handling non-linearities and complex interactions within the system.This approach could lead to more precise optimization outcomes.

Conclusion
Today, HESs are used extensively in different areas of the world to supply energy demand.The optimal design of these systems is an important issue and has created many challenges.In this paper, the Response Surface Methodology (RSM) is proposed as a powerful tool for optimal sizing of a Photovoltaic (PV) system in a hybrid energy system (HES).The introduced solution takes into account the climatic and geographical factors in the study site and technical and economic issues related to the HESs, and provides the most optimal sizing related to the PV system.In addition, the proposed technique mathematically modeled each of the variables affecting the performance of the PV system so that the impact of each on the output of the system could be analyzed.Finally, by presenting mathematical models for each input parameter and sensitivity analysis of each of them, the optimal size of the PV system was provided.The optimization model obtained using the analysis of variance (ANOVA) evaluation technique, one of the most important statistical evaluation procedures, was evaluated.It should be noted that the selected RSM model can be considered to optimize all components of a HES.

Fig. 1 .
Fig. 1.The structure of the system.

Table 2 .
Different types of algorithms to optimize the hybrid systems.

Table 3 .
The demands in the studied system.

need for water and energy In a day of winter The need for water and energy In a day of Summer
Vol.:(0123456789) Scientific Reports | (2024) 14:20226 | https://doi.org/10.1038/s41598-024-71035-9www.nature.com/scientificreports/The water flow rates balance is considered other constraint:

Table 5 .
Parameters and levels.

Table 6 .
Complete response surface methodology column of components size design.

Table 7 .
Response surface methodology column for environmental condition.

Table 8 .
Response surface methodology column for Spv.

Table 9 .
The ANOVA table for the coded coefficients in the studied system model.